//package com.zhs.study.rocketMq.basic;
//
//import org.apache.rocketmq.client.producer.DefaultMQProducer;
//import org.apache.rocketmq.client.producer.SendResult;
//import org.apache.rocketmq.common.message.Message;
//
///**
// *
// * @Author zhenghuisheng
// * @Date：2025/4/8 19:24
// */
//public class SimpleProducer {
//    public static void main(String[] args) throws Exception {
//        DefaultMQProducer producer = new DefaultMQProducer("demo-producer-group");
//        producer.setNamesrvAddr("192.168.1.246:9876"); // 改成你的 NameServer 地址
//        producer.start();
//        Message msg = new Message("zhsTopic", "TagA", "Hello RocketMQ!".getBytes());
//        for (int i = 0; i < 10000; i++) {
//            SendResult sendResult = producer.send(msg);
//            System.out.printf("发送结果：%s%n", sendResult);
//        }
//        producer.shutdown();
//    }
//}
